import base64toBlob from './base64toBlob'
/**
 * @category  base64格式转文件格式
 * @description base64格式转文件格式
 * @param data {any}
 * @param file_name {string}
 * @example base64toFile(data, file_name) => file
 */

 export default function base64toFile (data: any, file_name: string) {
    const blob = new Blob([base64toBlob(data)], {
        type:
      'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
    })
    const file = new File([blob], file_name, {
        type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        lastModified: Date.now()
    })
    return file
};
